<h2>时间工具类使用前请安装：npm i great-jsutils --save</h2>
<div class="panel panel-primary">
  <div class="panel-heading">获取上午好、下午好……</div>
  <div class="panel-body">
    <h2>{{hello}}</h2>
  </div>
  <div class="panel-footer">
    TimeUtils.sayHello();
  </div>
</div>

<div class="panel panel-success">
  <div class="panel-heading">获取某天开始结束时间</div>
  <div class="panel-body">
    <p>四天前：{{fourDaysAgo | json}}</p>
    <p>大前天：{{threeDaysAgo | json}}</p>
    <p>前天：{{beforeYesterday| json}}</p>
    <p>昨天：{{yesterday| json}}</p>
    <p>今天：{{today| json}}</p>
    <p>明天：{{tomorrow| json}}</p>
    <p>后天：{{afterTomorrow| json}}</p>
  </div>
  <div class="panel-footer">
    <p>示例：TimeUtils.getDayTime(num)</p>
    <p>本函数用于获取某天开始、结束时间，接收一个参数，默认为0。</p>
    <p>传入正数，则为未来某天；传入负数，则为过去某天。</p>
    <p>例如昨天：TimeUtils.getDayTime(-1);</p>
    <p>例如明天：TimeUtils.getDayTime(1);</p>
  </div>
</div><div class="panel panel-primary">
  <div class="panel-heading">获取某天开始结束时间：组合使用</div>
  <div class="panel-body">
    <p class="text-danger">一周内：{{within7days| json}}</p>
    <p class="text-danger">30天内：{{within30days| json}}</p>
  </div>
</div>
<div class="panel panel-success">
  <div class="panel-heading">获取某周开始结束时间</div>
  <div class="panel-body">
    <p>前周：{{previousWeek| json}}</p>
    <p>上周：{{lastWeek| json}}</p>
    <p>本周：{{thisWeek| json}}</p>
    <p>下周：{{nextWeek| json}}</p>
  </div>
  <div class="panel-footer">
    TimeUtils.getWeekTime(number)
  </div>
</div>
<div class="panel panel-danger">
  <div class="panel-heading">获取某月开始结束时间</div>
  <div class="panel-body">
    <p>上月{{lastMonth|json}}</p>
    <p>本月{{thisMonth|json}}</p>
    <p>下月{{nextMonth|json}}</p>
  </div>
  <div class="panel-footer">
    TimeUtils.getMonthTime(number)
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">获取某季度开始结束时间</div>
  <div class="panel-body">
    <p>上季度{{lastQuarter|json}}</p>
    <p>本季度{{thisQuarter|json}}</p>
    <p>下季度{{nextQuarter|json}}</p>
  </div>
  <div class="panel-footer">
    TimeUtils.getQuarterTime(number)
  </div>
</div>
<div class="panel panel-warning">
  <div class="panel-heading">获取某年开始结束时间</div>
  <div class="panel-body">
    <p>上年{{lastYear|json}}</p>
    <p>本年{{thisYear|json}}</p>
    <p>下年{{nextYear|json}}</p>
  </div>
  <div class="panel-footer">
    TimeUtils.getYearTime(number)
  </div>
</div>
<div class="panel panel-primary">
  <div class="panel-heading">获取随机时间</div>
  <div class="panel-body">
    <table class="table">
      <tr>
        <th>#</th>
        <th>创建时间</th>
        <th>到期时间</th>
        <th>启用时间</th>
        <th>结束时间</th>
      </tr>
      <tr *ngFor="let item of randomTimeList;let i = index;">
        <td>{{i+1}}</td>
        <td>{{item.time1}}</td>
        <td>{{item.time2}}</td>
        <td>{{item.time3}}</td>
        <td>{{item.time4}}</td>
      </tr>
    </table>
  </div>
  <div class="panel-footer">
    TimeUtils.random()
  </div>
</div>
<div class="panel panel-default">
  <div class="panel-heading">格式化时间</div>
  <div class="panel-body">
    <table class="table">
      <tr>
        <th>#</th>
        <th>创建时间</th>
        <th>到期时间</th>
        <th>启用时间</th>
        <th>结束时间</th>
        <th>当前时间</th>
      </tr>
      <tr *ngFor="let item of randomTimeList;let i = index;">
        <td>{{i+1}}</td>
        <td>{{item.time1}}</td>
        <td>{{item.time2}}</td>
        <td>{{item.time3}}</td>
        <td>{{item.time4}}</td>
        <td>{{item.time5}}</td>
      </tr>
    </table>
  </div>
  <div class="panel-footer">
    <p>TimeUtils.format(new Date(), TimeUtils.FORMAT_FULL_CN)</p>
    <p>TimeUtils.format(new Date(), 'yyyy-MM-dd')</p>
  </div>
</div>
